#include "stdafx.h"
#include "multi-thread.h"

namespace GlobalSet
{
	clock_t clockStart, clockFinish;
	double duration;
	INPUT_RECORD inRec;
	DWORD res;
	thread th1(Time);

	void Time()
	{
		while (1)
		{
			ReadConsoleInput(hIn, &inRec, 1, &res);
			if (EXIT == true) return;
			Sleep(50);
		}
	}

	void RecordClock()
	{
		clockStart = clock();	
	}

	void ExitThread()
	{
		EXIT = true;
		th1.join();
	}

	void RunClock()
	{
		clockFinish = clock();
		duration = (double)(clockFinish) / CLOCKS_PER_SEC;
	}
}


